home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
stat
/
prob111.lzh
/
PROB111.DOC
< prev
next >
Wrap
Text File
|
1980-01-01
|
7KB
|
220 lines
PROB.BAS v1.11
Joseph C. Hudson
PROB.BAS computes probabilities for the Binomial, Negative Binomial,
Hypergeometric and Poisson distributions. It computes probabilities and percent-
age points for the Standard Normal, Student's T, Chi-Square and F distributions.
The program is menu driven. PROB.BAS is designed to compute probabilities to 4
decimal places and percentage points to 4 significant figures. It meets these
goals, except perhaps for extremely large or small parameter values.
PROB.BAS uses finite series expansions to compute T, F and Chi-Square
probabilities. A combination of MacLauren series and continued fraction
expansion is used to compute standard normal probabilities. Percentage points
for the continuous distributions are computed using a one dimensional search
with nonlinear interpolation.
PROB can be invoked by typing PROB111 at the DOS prompt. This executes the
file PROB111.EXE. The screens PROB presents are described below. To stop the
program, type Q when this option appears on the screen. If you want to stop
execution when this option does not appear on screen, the control-break
combination will work. Control-C will not work.
You can also run PROB by using the source code file PROB111.BAS with the
basic interpreter BASICA or GWBASIC. This is quite a bit slower than using the
executable file.
The headings used by PROB.BAS for each distribution are listed below,
together with sample output and a brief description of the parameters.
This menu appears when the program starts:
SELECT A DISTRIBUTION:
1 BINOMIAL 2 NEGATIVE BINOMIAL
3 POISSON 4 HYPERGEOMETRIC
5 STD NORMAL 6 STD NORMAL INVERSE
7 STUDENT'S T 8 STUDENT'S T INVERSE
9 CHI SQUARE 10 CHI SQUARE INVERSE
11 F 12 F INVERSE
The individual displays follow. X, Z, T, X² and F are random variables with
the distribution in question. Lower case equivalents are values of these random
variables.
BINOMIAL DISTRIBUTION
N P x Pr( X = x ) Pr( X <= x )
15 .3120 5 0.2110 0.6855
N - sample size, number of trials
p - the probability of success on any trial
PROB.BAS PAGE 2
NEGATIVE BINOMIAL DISTRIBUTION
N P x Pr( X = x ) Pr( X <= x )
4 .5600 7 0.1675 0.6294
N - The number of successes required before stopping
p - The probability of success on any trial
POISSON DISTRIBUTION
Mu x Pr( X = x ) Pr( X <= x )
1.25 3 0.0933 0.9617
Mu - The mean of the distribution
HYPERGEOMETRIC DISTRIBUTION
N n k Min Max x Pr( X = x ) PR( X <= x )
25 12 15 2 12 8 0.2599 0.8558
N - Population size
n - Sample size
k - The number of possible successes in the population
Min and Max are the extreme values that X can take on. They are computed
by the program. x must be between these values.
STANDARD NORMAL DISTRIBUTION
z Pr( Z < z ) Pr( Z > z ) Pr( |Z| > |z| )
1.230 0.8907 0.1093 0.2187
PERCENTAGE POINTS OF THE STANDARD NORMAL DISTRIBUTION
Enter PROB, program returns z, where Pr( Z > z ) = PROB
PROB z
0.1000 1.282
STUDENT'S T DISTRIBUTION
DF t Pr( T < t ) Pr( T > t ) Pr( |T| > |t| )
57 2.140 0.9817 0.0183 0.0366
DF - degrees of freedom
PROB.BAS PAGE 3
PERCENTAGE POINTS OF THE STUDENT'S T DISTRIBUTION
Enter PROB, program returns t, where Pr( T > t ) = PROB
DF PROB t
67 0.1000 1.294
CHI - SQUARE DISTRIBUTION
DF x² Pr( X² < x² ) Pr( X² > x² )
23 30.400 0.8617 0.1383
DF - Degrees of freedom
PERCENTAGE POINTS OF THE CHI - SQUARE DISTRIBUTION
Enter PROB, program returns x², where Pr( X² > x² ) = PROB
DF PROB x²
23 0.0100 41.638
F DISTRIBUTION
DF1 DF2 f Pr( F < f ) Pr( F > f )
12 35 2.610 0.9865 0.0135
DF1 - Numerator degrees of freedom
DF2 - Denominator degrees of freedom
PERCENTAGE POINTS OF THE F DISTRIBUTION
Enter PROB, program returns f, where Pr( F > f ) = PROB
DF1 DF2 PROB f
17 12 0.0500 2.583
Suggestions and problem reports would be appreciated. Comments may be sent
to the author at the Department of Science and Mathematics, GMI Engineering and
Management Institute, 1700 W. Third Ave, Flint, MI 48504
PROB.BAS PAGE 4
References
Dudewicz, E. J. and S. R. Dalal, 1972, On approximations to the t-distribution.
Journal of Quality Technology, Vol 4 no 4.
Presents the finite cosine series expansion of the T CDF.
Koo, J. O., 1984, Algorithm to evaluate incomplete beta function ratio,
Proceedings of the Statistical Computing Section, American Statistical Associ-
ation, Washington, DC.
Presents formulas relevant to the F distribution, not used in PROB.BAS,
though a feasible alternative.
Moran, P. A. P., 1984, An Introduction to Probability Theory, Oxford University
Press, New York.
Generally good discussion of distributions.
Nonweiler, T. R. F., 1984, Computational Mathematics, an Introduction to Numr-
ical Approximation, Halstead Press, New York.
Discusses interpolation and continued fractions.
Volk, William, 1982, Engineering Statistics with a Programmable Calculator,
McGraw-Hill, New York.
Presents an understandable discussion of the finite series expansion of the
F CDF.
Zelen, M. and N. C. Severo, 1970, Probability Functions, chapter 26 in
Abramowitz, M. and I. A. Stegun (eds), Handbook of Mathematical Functions,
National Bureau of Standards Applied Mathematics Series, No. 55.
Has a wealth of material, but there have been a lot of corrections from the
1965 edition. I suspect more corrections are in order. Still, an important
reference. The recurrence relation on page 941 was used for X² in PROB.BAS.